﻿<UserControl
    x:Class="WinRTXamlToolkit.Sample.Views.ScrollViewerExtensionsTestView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:xcx="using:WinRTXamlToolkit.Controls.Extensions"
    xmlns:controls="using:WinRTXamlToolkit.Controls"
    mc:Ignorable="d">
    <UserControl.Resources>
        <DataTemplate
            x:Key="TestItemTemplate">
            <Border
                Width="500"
                Height="500"
                Background="{Binding Brush}">
                <TextBlock
                    VerticalAlignment="Center"
                    HorizontalAlignment="Center"
                    Text="{Binding Text}"
                    Foreground="#FFFF80FF"
                    FontSize="72" />
            </Border>
        </DataTemplate>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition
                Height="Auto" />
        </Grid.RowDefinitions>
        <StackPanel
            Grid.Row="1"
            Orientation="Horizontal">
            <Button
                x:Name="AnimatedScrollTestButton"
                Content="Animated Scroll"
                Click="OnAnimatedScrollTestButtonClick" />
            <Button
                x:Name="AnimatedZoomTestButton"
                Content="Animated Zoom"
                Click="OnAnimatedZoomTestButtonClick" />
        </StackPanel>

        <ScrollViewer
            x:Name="scrollViewer"
            HorizontalScrollBarVisibility="Auto"
            HorizontalScrollMode="Auto"
            VerticalScrollBarVisibility="Auto"
            VerticalScrollMode="Auto"
            ZoomMode="Enabled"
            MinZoomFactor="0.1"
            MaxZoomFactor="2">
            <Grid
                x:Name="scrolledGrid"
                Width="2500"
                Height="2500">
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
            </Grid>
        </ScrollViewer>
    </Grid>
</UserControl>
